package com.njym.java.security.app.biz;

import com.njym.java.security.app.entity.FamilyUser;
import com.njym.java.security.app.entity.UserRelation;
import com.njym.java.security.app.entity.UserRelationVo;
import com.njym.java.security.app.mapper.FamilyUserMapper;
import com.njym.java.security.app.mapper.UserRelationMapper;
import com.njym.java.security.common.biz.BaseBiz;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 
 *
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-22 16:44:11
 */
@Service
public class UserRelationBiz extends BaseBiz<UserRelationMapper,UserRelation> {
    @Resource
    private UserRelationMapper userRelationMapper;
    @Resource
    private FamilyUserMapper familyUserMapper;

    public List<UserRelationVo> queryFriendApply(Integer userId){
        return userRelationMapper.queryFriendApply(userId);
    }

    public List<FamilyUser> queryUser(String mobile){
        return familyUserMapper.queryUser(mobile);
    }

    public int updateRelation(Integer userId, Integer friendId){
        return userRelationMapper.updateRelation(userId, friendId);
    }

    public int rejectFriend(Integer userId, Integer friendId){
        return userRelationMapper.rejectFriend(userId, friendId);
    }

    public List<UserRelation> checkFriend(Integer userId, Integer friendId){
        return userRelationMapper.checkFriend(userId, friendId);
    }
}